const multer = require('koa-multer');
const {join} = require('path');

const storage = multer.diskStorage({
    // 存储的位置
    destination: join(__dirname, "../public/xlsx"),
    // 文件名
    filename(req, file, cb) {
        const format = file.originalname.split(".").pop();
        cb(null, `test.${format}`)
    }
});

module.exports = multer({storage});
